package com.ruoyi.oauth.sso.vo;


import com.ruoyi.oauth.utils.OAuthUtil;

import javax.servlet.http.HttpServletRequest;

/**
 * oauth请求对象
 */
public class OAuthRequest {
    private String clientId;
    private String clientSecret;
    private String redirectUri;
    private String scope;
    private String state;
    private String code;
    private String responseType;
    private String refreshToken;
    private String accessToken;

    public OAuthRequest(HttpServletRequest request){
        this.clientId = OAuthUtil.getClientId(request);
        this.clientSecret = OAuthUtil.getClientSecret(request);
        this.redirectUri = OAuthUtil.getRedirectUri(request);
        this.scope = OAuthUtil.getScope(request);
        this.state = OAuthUtil.getState(request);
        this.code = OAuthUtil.getCode(request);
        this.responseType = OAuthUtil.getResponseType(request);
    }

    public String getResponseType() {
        return responseType;
    }

    public void setResponseType(String responseType) {
        this.responseType = responseType;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getClientSecret() {
        return clientSecret;
    }

    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }

    public String getRedirectUri() {
        return redirectUri;
    }

    public void setRedirectUri(String redirectUri) {
        this.redirectUri = redirectUri;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
